package cn.ahxb.frame.common.base;

import android.os.Bundle;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.ButterKnife;

/**
 * Fragment 基类，封装一些常用的功能
 * 注意：使用的是v4包下的Fragment {@link Fragment}
 * Created by xuyougen on 2018/3/1.
 */

public abstract class BaseFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View layout = inflater.inflate(setLayoutResource(), container, false);
        ButterKnife.bind(this, layout);
        return layout;
    }

    protected abstract @LayoutRes
    int setLayoutResource();

}
